<?php
class UserIdentity extends CUserIdentity
{
    public function authenticate()
    {
        if ('yuxing' === $this->password) {
            $this->errorCode = self::ERROR_NONE;
        } else
            $this->errorCode = self::ERROR_PASSWORD_INVALID;

        return !$this->errorCode;
    }
}